import Login from "../login/Login.tsx";
import {createBrowserRouter} from "react-router";
import Redirect from "../login/Redirect.tsx";
import {isDevelopment} from "../utils";
import AutoLogin from "../login/AutoLogin.tsx";

const UnLoginRoute = () => {
    const isDev = isDevelopment();
    const catchAllElement = isDev ? <Login/> : <Redirect/>;

    return createBrowserRouter([
        {
            path: "/admin",
            element: <Login/>
        },
        {
            path: "/autoLogin",
            element: <AutoLogin/>
        },
        {
            path: "/*",
            element: catchAllElement
        }
    ])
};

export default UnLoginRoute;